#pragma once
/**************************************************************************/
/* CLimiter class - invisible Drawable, placed behind the player and      */
/*  awaits hit by ball - it's working like a switch, that kills player,   */
/*  when he fails to catch the ball.                                      */
/**************************************************************************/
#include "drawable.h"
#include "Bat.h"
#include "Physics.h"

class CLimiter :
	public CDrawable
{
private:
	CBat* m_pBatAttached;	//player's bat attached to this limiter
	dJointID m_jointTrack;	//joint that connects limiter to world
public:
	CLimiter(CBat* pBat, float fWidth, float fZpos);
	~CLimiter(void);

	void AttachBat(CBat* pBat) {m_pBatAttached = pBat;}
	CBat* GetAttachedBat() {return m_pBatAttached;}

	int Draw();

	//called when limiter is hitted by a ball:
	int Hit();

	int GetType() {return TYPE_LIMITER;}
};
